<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>transition</title>
    <style>
        .box{
            width: 100px;
            height: 100px;
            background-color: rgb(192, 118, 118);
            
        }
        .b1:hover{
            width: 250px;
            height: 250px;
            transition: all 0.5s;
        }
        input{
            
        }
        .b2{
            transition: all 0.5s;
        }
        input:checked+.b2{
            width: 250px;
            height: 250px;
        }

    </style>
</head>
<body>
    <div class="box b1">

    </div>
    <input type="checkbox">
    <div class="box b2">

    </div>
</body>
</html>